﻿<!DOCTYPE html>

<!--培训需求矩阵管理-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="/static/js/common.js"></script>
    <style>
        .el-dialog__body {
            height: 100% !important;
        }

        .el-dialog.is-fullscreen {
            overflow: hidden !important;
        }
    </style>
</head>

<body>
    
<div id="app" v-cloak>   
        <el-row>

            <el-col span="24">
                <el-form label-position=" right" ref="form" :inline="true" :model="formInline" class="demo-form-inline">
                    <el-row>
                        <el-col class="head-tool">
                            
<div class="new_title fl"><strong><img src="/static/images/icon1.png" />选择修改上次执行时间的矩阵</strong>
                            </div>
                            <span>
                                <btn :text="col.btnSelect" imgsrc="/static/images/search.png" linetype="3"
                                    @click="onSubmit"></btn>
                                <!--<btn :text="col.btnAdd" linetype="3" @click="UserInput('tj')"></btn>
                                <btn-export-list url="/api/PX_Matrix/Export" :forminline="this.formInline" linetype="3">
                                </btn-export-list>-->
                                <btn :text="'选择'" imgsrc="/static/images/search.png" linetype="4" @click="onSelect"></btn>
                            </span>
                        </el-col>
                    </el-row>
                    <el-row>
                        <!--<el-col :xs="8" :sm="8" :md="8" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input v-model="formInline.model.NameofTrainingNeeds"
                                        :placeholder="TrainingDemandMatrixManagement.NameofTrainingNeeds" size="mini">
                                        <template slot="prepend">
                                            {{TrainingDemandMatrixManagement.NameofTrainingNeeds+mark.m}}
                                        </template>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>-->
                        <!--技能要求-->
                        <el-col :xs="8" :sm="8" :md="8" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item size="mini">
                                    <el-input>
                                        <template slot="prepend">
                                            {{TrainingDemandMatrixManagement.SkillsRequirements+mark.m}}
                                        </template>
                                        <el-select @visible-change="visibleChange" v-model="formInline.model.SkillsRequirements" slot="suffix"
                                            :placeholder="TrainingDemandMatrixManagement.SkillsRequirements">
                                            <el-option label="请选择" value=""></el-option>
                                            <el-option v-for="item in SkillsRequirements" :label="item.value"
                                                :value="item.key"></el-option>
                                        </el-select>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>

                        <!--岗位-->
                        <!--<el-col :xs="8" :sm="8" :md="8" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item size="mini">
                                    <el-input>
                                        <template slot="prepend">
                                            {{TrainingDemandMatrixManagement.post+mark.m}}
                                        </template>
                                        <el-select @visible-change="visibleChange" v-model="formInline.model.post" slot="suffix"
                                                   :placeholder="TrainingDemandMatrixManagement.post">
                                            <el-option label="请选择" value=""></el-option>
                                            <el-option v-for="item in post" :label="item.value" :value="item.value">
                                            </el-option>
                                        </el-select>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>-->
                        <!--课件-->
                        <el-col :xs="8" :sm="8" :md="8" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item size="mini">
                                    <el-input>
                                        <template slot="prepend">
                                            {{TrainingDemandMatrixManagement.trainingcourse+mark.m}}
                                        </template>
                                        <el-select @visible-change="visibleChange" v-model="formInline.model.trainingcourse" slot="suffix"
                                            :placeholder="TrainingDemandMatrixManagement.trainingcourse">
                                            <el-option label="请选择" value=""></el-option>
                                            <el-option v-for="item in trainingClass" :label="item.coursewareName" :value="item.id">
                                            </el-option>
                                        </el-select>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>

                    </el-row>
                </el-form>

                <!--<el-col span="4">
                  
                    <div class="tree_lay">
                        <h4 class="title clearfix"><strong>岗位</strong></h4>
                        <el-tree :data="TreeData" :props="defaultProps" @node-click="handleNodeClick">
                            <span slot-scope="scope">
                                <span>
                                    <i :class="scope.data.icon"></i>
                                    <template>
                                        <span v-if="scope.data.icon == 'tree-open'"
                                            style="color:#12489e">{{ scope.node.label }}</span>
                                        <span v-else-if="scope.data.icon == 'tree-close'"
                                            style="color: #12489e">{{ scope.node.label }}</span>
                                        <span v-else>{{ scope.node.label }}</span>
                                    </template>
                                </span>
                            </span>
                        </el-tree>
                    </div>
                </el-col>-->
                <el-col span="24">
                    <el-table ref="table" stripe :data="ListItem.tableData" :row-key="getRowKeys"
                              :height="ListItem.tableHeight" border @selection-change="handleSelectionChange"
                              row-style="height:10px" style="width: 100%;height: 100%;">
                        <el-table-column type="selection" style="
                padding-top: 0px;
                padding-bottom: 0px;
            " align="center" width="55" :reserve-selection="true">
                        </el-table-column>
                        <!-- 除第一列以外 遍历所有字段 -->
                        <!--user建议替换为表名 需要与resource文件夹下js 中的对象保持一致  下同-->
                        <el-table-column type="index" :label="col.SequenceNumber" :index="indexMethod" width="50"
                                         show-overflow-tooltip="true"></el-table-column>
                        <!-- <el-table-column prop="NameofTrainingNeeds" :label="TrainingDemandMatrixManagement.NameofTrainingNeeds"
        width="180" show-overflow-tooltip="true">
    </el-table-column> -->
                        <!--培训课程-->
                        <el-table-column prop="mark02" :label="'岗位'"
                                         width="180" show-overflow-tooltip="true">
                        </el-table-column>
                        <el-table-column prop="mark01" :label="TrainingDemandMatrixManagement.trainingcourse"
                                         width="180" show-overflow-tooltip="true">
                        </el-table-column>
                        <!--岗位-->
                        <!--<el-table-column prop="post" :label="TrainingDemandMatrixManagement.post" min-width="150"
                     show-overflow-tooltip="true">
    </el-table-column>-->
                        <!--技能要求-->
                        <el-table-column prop="skillsRequirements"
                                         :label="TrainingDemandMatrixManagement.SkillsRequirements" min-width="150"
                                         show-overflow-tooltip="true">
                        </el-table-column>
                        <!--培训频次(年/次)-->
                        <el-table-column prop="trainTime"
                                         :label="TrainingDemandMatrixManagement.TrainingFrequencyYear" width="180"
                                         show-overflow-tooltip="true">
                        </el-table-column>
                        <!--备注-->
                        <!--<el-table-column prop="MatrixDescription"
                     :label="TrainingDemandMatrixManagement.MatrixDescription" width="180"
                     show-overflow-tooltip="true">
    </el-table-column>-->

                        <el-table-column width="53" :label="col.btnUpdate" fixed="right">
                            <template slot-scope="scope">
                                <button type="button" class="elst-bt-xg" @click=UserInput('xg',scope.row.post)>
                                    <i class="el-icon-edit"></i>
                                </button>
                            </template>
                        </el-table-column>

                    </el-table>
                    <el-row type="flex" justify="end">
                        <el-pagination ref="page" @size-change="handleSizeChange" @current-change="handleCurrentChange"
                            :current-page="ListItem.currentPage" :page-sizes="ListItem.pagesizes"
                            :page-size="ListItem.pagesize" :layout="ListItem.layout" :total="ListItem.total">
                        </el-pagination>
                    </el-row>
                </el-col>





                <!--user建议替换为表名 需要与resource文件夹下js 中的对象保持一致  -->
                <el-dialog title="培训需求矩阵管理" :visible.sync="ListItem.dialogVisible" @close='closeDialog' width="80%"
                    height="80%" top="10vh" fullscreen="true">
                    <iframe ref="iframe" :src="ListItem.InputUrl" style="height:100%;width:100%"
                        frameborder="0"></iframe>
                </el-dialog>
            </el-col>
        </el-row>
    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                id: '',
                TreeData: [],
                mydata: RiskControlInformation,

                defaultProps: {
                    children: 'children',
                    label: 'label'
                },

                ListItem: ListItem,
                sqldata: treeTrainingDemandMatrixManagementCategoryData,
                treeTrainingDemandMatrixManagementCategoryData: [],
                value1: '',
                SkillsRequirements: [],
                post: [],
                trainingClass: [],//培训课程

                checked: true,
                isShow: true,
                formInline: {
                    model: {
                        id:'',
                        PersonnelName: '',
                        Subordinatedepartments: '',
                        Nameofcertificate: '',
                        Issuancetime: '',
                        Maturitytime: '',
                        Certificatetype: '',
                        LicenseCoding: '',
                        Licensingauthority: '',
                        Termofvalidity: '',
                        describe: '',
                        TreeNode: '',
                    },
                    offset: 0,
                    limit: 10
                },
            },
            mounted: function () {

                this.id = getUrlParam("id");
                //获取下拉菜单内容
                this.SkillsRequirements = getDicData('技能要求');
                
                var mythis = this;
                myAjax("post", this, '/api/PX_Course/GetListForDropDown', { limit: 10, offset: 0 }, function (response) {
                    mythis.trainingClass = response.data.pageData;
                }, false);

  
                //初始化数据
                this.GetPageData(1);
                //列表高度自适应
                tablehigh(this);
                
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                indexMethod: function (index) {
                    return (this.ListItem.currentPage - 1) * this.ListItem.pagesize + index + 1;
                },
                handleNodeClick: function (data) {
                    if (!data.children) {
                        this.formInline.model.post = data.id
                        onSubmit(this);
                    } else {
                        if (data.icon == "tree-open") {
                            data.icon = "tree-close"
                        } else (
                            data.icon = "tree-open"
                        )
                    }
                },
                //关闭Dialog 回调
                closeDialog: function () { closeDialog(this); },
                //Model 替换成 表名
                onSelect: function () {
                    var mythis = this;
                    if (mythis.ListItem.tableMultipleSelection.length == 0) {
                        showMessage(msg.AtLeastOne, 'error')
                        return;
                    }

                    mythis.$confirm(' 选择后该培训将完成，是否确认?', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }).then(function () {
                        //console.log(123)
                        var delIds = [];
                        for (var i = 0; i < mythis.ListItem.tableMultipleSelection.length; i++) {
                            var item = mythis.ListItem.tableMultipleSelection[i];
                            delIds.push(item.id);
                        }
                        myAjax("get", mythis, '/api/PX_Plan/WCPX?id=' + mythis.id, null, function (response) {
                            
                        });
                        myAjax("post", mythis, '/api/PX_Matrix/XGSCZXSJ', delIds, function (response) {
                            
                            showMessage(msg.OperatingOk, "success");
                            parent.app.ListItem.dialogVisible = false;
                            parent.app.ListItem.currentPage = 1;
                            parent.app.GetPageData(1);
                        });
                    }).catch(function () {
                        showMessage("已取消!");
                    });

                },

                handleSelectionChange: function (val) { handleSelectionChange(this, val); },
                //Model 替换成 表名
                UserInput: function (val, id) { DialogShow(this, val, "TrainingDemandMatrixManagementInputNew.html", id); },
                UserInputStatistics: function (val, id) { DialogShow(this, val, "TrainingDemandMatrixManagementlistInput.html", id); },
                //Model 替换成 表名
                GetPageData: function (currentIndex) {
                    this.formInline.model.id = this.id;
                    GetPageData(this, currentIndex, '/api/PX_Matrix/GetWCList')
                },

                onSubmit: function () { onSubmit(this); },

                handleSizeChange: function (val) { handleSizeChange(this, val); },

                handleCurrentChange: function (val) { handleCurrentChange(this, val); },

            }
        });
    </script>

</body>

</html>